package top.scsoul.voes.examination.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;
import top.scsoul.voes.common.core.domain.entity.User;

import javax.validation.constraints.Future;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.io.Serializable;

/**
 * (Examination)实体类
 *
 * @author guolei
 * @since 2021-07-21 15:37:33
 */
public class Examination implements Serializable {
    private static final long serialVersionUID = 839498403627355052L;
    /**
     * id
     */
    @Excel(name = "编号")
    private Integer id;
    /**
     * 考试名称
     */
    @Length(min = 1, max = 50, message = "考试名称长度在1-50")
    @Excel(name = "考试名称")
    private String examName;
    /**
     * 考试科目
     */
    @Excel(name = "考试科目")
    private Integer examSubject;
    /**
     * 命题人
     */
    private Integer examProvider;
    /**
     * 命题人
     */
    private User examProviderUser;
    /**
     * 开考时间
     */
    @NotNull(message = "开考时间不能为空")
    @Future(message = "开考时间必须是将来的一个时间")
    @Excel(name = "开考时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date examBeginTime;
    /**
     * 结束时间
     */
    @NotNull(message = "考试结束时间不能为空")
    @Future(message = "考试结束时间必须是将来的一个时间")
    @Excel(name = "结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date examOverTime;
    /**
     * 考试地点
     */
    @Length(min = 1, max = 50, message = "考试地点长度在1-50之间")
    @Excel(name = "考试地点")
    private String examLocation;
    /**
     * 考试状态
     */
    @Range(min = 1, max = 4, message = "考试状态必须在1-4之间")
    @Excel(name = "考试状态")
    private Integer examState;
    /**
     * 参考人数
     */
    @Excel(name = "参考人数")
    private Integer examJoinNum;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getExamName() {
        return examName;
    }

    public void setExamName(String examName) {
        this.examName = examName;
    }

    public Integer getExamSubject() {
        return examSubject;
    }

    public void setExamSubject(Integer examSubject) {
        this.examSubject = examSubject;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Integer getExamProvider() {
        return examProvider;
    }

    public void setExamProvider(Integer examProvider) {
        this.examProvider = examProvider;
    }

    public User getExamProviderUser() {
        return examProviderUser;
    }

    public void setExamProviderUser(User examProviderUser) {
        this.examProviderUser = examProviderUser;
    }

    public Date getExamBeginTime() {
        return examBeginTime;
    }

    public void setExamBeginTime(Date examBeginTime) {
        this.examBeginTime = examBeginTime;
    }

    public Date getExamOverTime() {
        return examOverTime;
    }

    public void setExamOverTime(Date examOverTime) {
        this.examOverTime = examOverTime;
    }

    public String getExamLocation() {
        return examLocation;
    }

    public void setExamLocation(String examLocation) {
        this.examLocation = examLocation;
    }

    public Integer getExamState() {
        return examState;
    }

    public void setExamState(Integer examState) {
        this.examState = examState;
    }

    public Integer getExamJoinNum() {
        return examJoinNum;
    }

    public void setExamJoinNum(Integer examJoinNum) {
        this.examJoinNum = examJoinNum;
    }

    @Override
    public String toString() {
        return "Examination{" +
                "id=" + id +
                ", examName='" + examName + '\'' +
                ", examSubject=" + examSubject +
                ", examProvider=" + examProvider +
                ", examProviderUser=" + examProviderUser +
                ", examBeginTime=" + examBeginTime +
                ", examOverTime=" + examOverTime +
                ", examLocation='" + examLocation + '\'' +
                ", examState=" + examState +
                ", examJoinNum=" + examJoinNum +
                '}';
    }
}